package com.zxjbyte.yiyi.module.plugin.job.domain.request;

import com.zxjbyte.yiyi.framework.quartz.handler.IJobHandler;
import com.zxjbyte.yiyi.module.plugin.job.domain.dto.JobConfigDTO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import javax.validation.constraints.NotBlank;


/**
 * quartz定时任务新增
 * @Author zhangxingjia
 * @Date 2023/11/9 10:43
 * @Version: 1.0
 */
@Data
@Schema(description = "新增定时任务")
public class QJobAddRequest {

    @Schema(description = "任务名")
    @NotBlank(message = "任务名不能为空")
    private String jobName;

    @Schema(description = "任务组")
    private String jobGroup;

    @Schema(description = "cron表达式")
    @NotBlank(message = "cron表达式不能为空")
    private String cronExpression;

    @Schema(description = "目标任务处理器类名")
    @NotBlank(message = "目标任务处理器类名不能为空")
    private String jobHandler;

    /**
     * 自定义执行方法支持传所执行方法名
     * 如果时实现
     *  @see IJobHandler
     * 接口可不传
     */
    @Schema(description = "目标处理器执行方法")
    private String jobMethodName;

    @Schema(description = "方法参数")
    private String methodParam;

    @Schema(description = "任务配置")
    private JobConfigDTO jobConfig = new JobConfigDTO();
}
